package com.itcast.beans

class IntDoubleString(val str:String){
    def toIntPlus = try {
      str.toInt
    }catch {
      case _:Exception => 0
    }
  def toDoublePlus = try {
    str.toDouble
  }catch {
    case _:Exception => 0d
  }
}

object IntDoubleString{
  implicit def str2IntDoubleString(str:String) = new IntDoubleString(str)
}